package day04;
//while结构的演示
public class WhileDemo {
    public static void main(String[] args) {
        //1)输出5次“行动是成功的阶梯”：
        int times = 0;
        while (times<5){
            System.out.println("行动是成功的阶梯");
            times++;
        }
        /**
         * 执行过程：
         * times=0
         * times<5?    true      输出    times+1
         * times = 1
         * times<5?    true     输出     times+1
         * times = 2
         * times<5?    true     输出     times+1
         * times = 3
         * times<5?    true     输出     times+1
         * times = 4
         * times<5?     true     输出     times+1
         * times = 5
         * times<5?    false    结束
         */

        //2)输出9的乘法表：
        int num = 1;
        while (num<=9){
            System.out.println(num+"*9="+num*9);
            num++;
        }
        System.out.println("继续执行...");
    }
}
